package com.sanwu.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.sanwu.dto.BusinessDto;
import com.sanwu.service.BusinessService;
import com.sanwu.vo.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author hgh
 * @date 2025/3/11
 * @apiNote
 */

@Slf4j
@Component
@Api(tags = "用户端-业务流程接口")
@RestController("/business")
public class BusinessController extends BaseController {

    @Resource
    private BusinessService businessService;

    @PostMapping("/insertBusiness")
    @ApiOperation("/新增业务")
    public AjaxResult insertBusiness(@RequestBody BusinessDto businessDto) {
        return businessService.insertBusiness(businessDto);
    }

    @PostMapping("/queryBusiness")
    @ApiOperation("/查看业务执行进度")
    public AjaxResult queryBusiness(@RequestBody BusinessDto businessDto) {
        return businessService.queryBusiness(businessDto);
    }

    @PostMapping("/dealBusiness")
    @ApiOperation("/处理业务")
    public AjaxResult dealBusiness(@RequestBody BusinessDto businessDto) {
        return businessService.dealBusiness(businessDto);
    }

}
